package com.bang.springcloud.service.impl;

import com.bang.springcloud.persist.model.User;
import com.bang.springcloud.persist.model.mapper.UserMapper;
import com.bang.springcloud.persist.model.mapper.UserMapperExt;
import com.bang.springcloud.provider.domain.dto.UserDto;
import com.bang.springcloud.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName: UserServiceImpl
 * @author: BANG
 * @Date: 2019/12/03 14:29
 * @Version: 1.0
 * @Modified By:
 * @Desc: TODO
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapperExt userMapperExt;

    @Override
    public UserDto get(Long userId) {
        User user = userMapperExt.selectByPrimaryKey(userId);
        if (null != user) {
            return new UserDto().setName(user.getLeader()).setPassword(user.getPwd());
        }
        return null;
    }
}
